package com.itshen.entity;

import lombok.Data;
import org.hibernate.validator.constraints.Range;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;

import javax.validation.constraints.NotBlank;

@Data
@Document(collection = "webflu-test-xuser")
public class User {

    @Id
    private String id;

    @NotBlank(message = "名字不能为空")
    private String name;

    @Range(min = 10,max = 100,message = "年龄区间必须为10-100")
    private Integer age;
}
